Get Value of Light Sensor

  • Function:

    magicbox.get_light_value(port)
    
  • Description: get light intensity of light sensor

  • Required parameter:

    • port: controller port, range: 3 or 4
  • Return:
    • value: value of light sensor, range: 0~1023
  • Example

    res = magicbox.get_light_value(port=3)
    print(res)
    

    Get light intensity of knob potentiometer connected to Port 3 of controller.

results matching ""

    No results matching ""